.class final Lcom/ninesky/browser/view/at;
.super Landroid/widget/BaseAdapter;


# instance fields
.field a:[Landroid/graphics/Bitmap;

.field final synthetic b:Lcom/ninesky/browser/view/ToolBar;

.field private c:Landroid/os/AsyncTask;

.field private d:Landroid/view/LayoutInflater;


# direct methods
.method constructor <init>(Lcom/ninesky/browser/view/ToolBar;)V
    .locals 1

    iput-object p1, p0, Lcom/ninesky/browser/view/at;->b:Lcom/ninesky/browser/view/ToolBar;

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    invoke-static {p1}, Lcom/ninesky/browser/view/ToolBar;->b(Lcom/ninesky/browser/view/ToolBar;)Lcom/ninesky/browser/BrowserActivity;

    move-result-object v0

    invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/view/at;->d:Landroid/view/LayoutInflater;

    const/16 v0, 0x8

    new-array v0, v0, [Landroid/graphics/Bitmap;

    iput-object v0, p0, Lcom/ninesky/browser/view/at;->a:[Landroid/graphics/Bitmap;

    return-void
.end method


# virtual methods
.method public final a()V
    .locals 2

    iget-object v0, p0, Lcom/ninesky/browser/view/at;->c:Landroid/os/AsyncTask;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/ninesky/browser/view/at;->c:Landroid/os/AsyncTask;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/os/AsyncTask;->cancel(Z)Z

    :cond_0
    new-instance v0, Lcom/ninesky/browser/view/q;

    invoke-direct {v0, p0}, Lcom/ninesky/browser/view/q;-><init>(Lcom/ninesky/browser/view/at;)V

    iput-object v0, p0, Lcom/ninesky/browser/view/at;->c:Landroid/os/AsyncTask;

    iget-object v0, p0, Lcom/ninesky/browser/view/at;->c:Landroid/os/AsyncTask;

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Void;

    invoke-virtual {v0, v1}, Landroid/os/AsyncTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    return-void
.end method

.method public final getCount()I
    .locals 2

    const/16 v1, 0x8

    invoke-static {}, Lcom/ninesky/browser/TabControl;->a()Lcom/ninesky/browser/TabControl;

    move-result-object v0

    invoke-virtual {v0}, Lcom/ninesky/browser/TabControl;->i()I

    move-result v0

    if-lt v0, v1, :cond_0

    move v0, v1

    :goto_0
    return v0

    :cond_0
    invoke-static {}, Lcom/ninesky/browser/TabControl;->a()Lcom/ninesky/browser/TabControl;

    move-result-object v0

    invoke-virtual {v0}, Lcom/ninesky/browser/TabControl;->i()I

    move-result v0

    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method

.method public final getItem(I)Ljava/lang/Object;
    .locals 1

    invoke-static {}, Lcom/ninesky/browser/TabControl;->a()Lcom/ninesky/browser/TabControl;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/ninesky/browser/TabControl;->a(I)Lcom/ninesky/browser/n;

    move-result-object v0

    return-object v0
.end method

.method public final getItemId(I)J
    .locals 2

    int-to-long v0, p1

    return-wide v0
.end method

.method public final getItemViewType(I)I
    .locals 3

    const/4 v2, 0x1

    const/4 v0, 0x2

    iget-object v1, p0, Lcom/ninesky/browser/view/at;->a:[Landroid/graphics/Bitmap;

    if-eqz v1, :cond_1

    invoke-virtual {p0}, Lcom/ninesky/browser/view/at;->getCount()I

    move-result v1

    if-ge p1, v1, :cond_1

    iget-object v1, p0, Lcom/ninesky/browser/view/at;->a:[Landroid/graphics/Bitmap;

    aget-object v1, v1, p1

    if-eqz v1, :cond_1

    move v0, v2

    :cond_0
    :goto_0
    return v0

    :cond_1
    invoke-virtual {p0}, Lcom/ninesky/browser/view/at;->getCount()I

    move-result v1

    sub-int/2addr v1, v2

    if-ne p1, v1, :cond_0

    const/4 v0, 0x0

    goto :goto_0
.end method

.method public final getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 5

    const/4 v4, 0x0

    const/4 v3, 0x1

    invoke-virtual {p0, p1}, Lcom/ninesky/browser/view/at;->getItemViewType(I)I

    move-result v0

    if-nez p2, :cond_6

    if-eq v3, v0, :cond_0

    const/4 v1, 0x2

    if-ne v1, v0, :cond_3

    :cond_0
    iget-object v1, p0, Lcom/ninesky/browser/view/at;->d:Landroid/view/LayoutInflater;

    const v2, 0x7f030032

    invoke-virtual {v1, v2, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    :goto_0
    if-ne v3, v0, :cond_5

    invoke-static {}, Lcom/ninesky/browser/TabControl;->a()Lcom/ninesky/browser/TabControl;

    move-result-object v2

    invoke-virtual {v2, p1}, Lcom/ninesky/browser/TabControl;->a(I)Lcom/ninesky/browser/n;

    move-result-object v2

    if-eqz v2, :cond_5

    const v0, 0x7f0c00ad

    invoke-virtual {v1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout;

    invoke-static {}, Lcom/ninesky/browser/TabControl;->a()Lcom/ninesky/browser/TabControl;

    move-result-object v2

    invoke-virtual {v2}, Lcom/ninesky/browser/TabControl;->g()I

    move-result v2

    if-ne p1, v2, :cond_4

    invoke-virtual {v0, v3}, Landroid/widget/LinearLayout;->setSelected(Z)V

    :goto_1
    const v0, 0x7f0c00b0

    invoke-virtual {v1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageButton;

    new-instance v2, Lcom/ninesky/browser/view/p;

    invoke-direct {v2, p0, p1}, Lcom/ninesky/browser/view/p;-><init>(Lcom/ninesky/browser/view/at;I)V

    invoke-virtual {v0, v2}, Landroid/widget/ImageButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    iget-object v0, p0, Lcom/ninesky/browser/view/at;->a:[Landroid/graphics/Bitmap;

    aget-object v2, v0, p1

    const v0, 0x7f0c00ae

    invoke-virtual {v1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    if-eqz v2, :cond_1

    invoke-virtual {v2}, Landroid/graphics/Bitmap;->isRecycled()Z

    move-result v3

    if-nez v3, :cond_1

    invoke-virtual {v0, v2}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    :cond_1
    new-instance v2, Lcom/ninesky/browser/view/s;

    invoke-direct {v2, p0, p1}, Lcom/ninesky/browser/view/s;-><init>(Lcom/ninesky/browser/view/at;I)V

    invoke-virtual {v0, v2}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    const v0, 0x7f0c00af

    invoke-virtual {v1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    invoke-static {}, Lcom/ninesky/browser/TabControl;->a()Lcom/ninesky/browser/TabControl;

    move-result-object v2

    invoke-virtual {v2, p1}, Lcom/ninesky/browser/TabControl;->a(I)Lcom/ninesky/browser/n;

    move-result-object v2

    invoke-virtual {v2}, Lcom/ninesky/browser/n;->q()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    new-instance v2, Lcom/ninesky/browser/view/r;

    invoke-direct {v2, p0, p1}, Lcom/ninesky/browser/view/r;-><init>(Lcom/ninesky/browser/view/at;I)V

    invoke-virtual {v0, v2}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    :cond_2
    :goto_2
    return-object v1

    :cond_3
    if-nez v0, :cond_6

    iget-object v1, p0, Lcom/ninesky/browser/view/at;->d:Landroid/view/LayoutInflater;

    const v2, 0x7f030033

    invoke-virtual {v1, v2, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    goto :goto_0

    :cond_4
    const/4 v2, 0x0

    invoke-virtual {v0, v2}, Landroid/widget/LinearLayout;->setSelected(Z)V

    goto :goto_1

    :cond_5
    if-nez v0, :cond_2

    const v0, 0x7f0c00b1

    invoke-virtual {v1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/FrameLayout;

    new-instance v2, Lcom/ninesky/browser/view/o;

    invoke-direct {v2, p0, p1}, Lcom/ninesky/browser/view/o;-><init>(Lcom/ninesky/browser/view/at;I)V

    invoke-virtual {v0, v2}, Landroid/widget/FrameLayout;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    goto :goto_2

    :cond_6
    move-object v1, p2

    goto/16 :goto_0
.end method

.method public final getViewTypeCount()I
    .locals 1

    const/4 v0, 0x3

    return v0
.end method
